﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace TheDrinksApp.ViewModel
{
    public class ObservableObject : INotifyPropertyChanged, INotifyPropertyChanging
    {
        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region INotifyPropertyChanging Members

        public event PropertyChangingEventHandler PropertyChanging;

        #endregion
        /// <summary>
        /// raise propertiy changed event
        /// </summary>
        /// <param name="propertyName"> property 's Name</param>
        protected void NotifyPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handle = PropertyChanged;
            if (null != handle)
            {
                handle(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        /// <summary>
        /// raise propertiy changing event
        /// </summary>
        /// <param name="propertyName"> property 's Name</param>
        protected void NotifyPropertyChanging(string propertyName)
        {
            PropertyChangingEventHandler handle = PropertyChanging;
            if (null != handle)
            {
                handle(this, new PropertyChangingEventArgs(propertyName));
            }
        }
    }
}
